@extends('layouts.back_stage')
@section('content')
    <link rel="stylesheet" href="{{env('CDN_DOMAIN_NAME')}}/css/lining.css?v=1.0.3">
    <script src="{{env('CDN_DOMAIN_NAME')}}/js/commonjs/jquery.select.js"></script>
    <script>
        //供应商
        var suppliers = [
                <?php $j = count($suppliers_arr);$i = 0; ?>
                @foreach ($suppliers_arr as $k=>$v )'{{$v["name"]}}'<?php $i++;?> @if($i<$j),@endif
            @endforeach
        ];
        //颜色
        var colors = [
                <?php $j = count($colors_arr);$i = 0; ?>
                @foreach ($colors_arr as $k=>$v )
            '{{$v["color_name"]}}'<?php $i++;?> @if($i<$j),@endif
            @endforeach
        ];
    </script>
    <div class="container">
        <div class="row">
            <div style="margin:30px;"><h3>添加面料信息</h3></div>
            <div style="width:90%;margin-left:100px;">
                <form role="form" >
                    <div class="form-group">
                        <ul class="form_ul">
                            <li class="form_li"><span class="xing">*</span>使用年份：
                                <select class="sel_inp ip1">
                                    <option value="">请选择</option>
                                    <option value="2016">2016</option>
                                    <option value="2017">2017</option>
                                    <option value="2018">2018</option>
                                    <option value="2019">2019</option>
                                    <option value="2020">2020</option>
                                </select>
                            </li>
                            <li class="form_li"><span class="xing">*</span>使用季节：
                                <select class="sel_inp ip2">
                                    <option value="">请选择</option>
                                    <option value="1">春季</option>
                                    <option value="2">夏季</option>
                                    <option value="3">秋季</option>
                                    <option value="4">冬季</option>
                                    <option value="5">四季</option>
                                </select>
                            </li>
                            <li class="form_li"><span class="xing">*</span>子类：
                                <select class="sel_inp ip3 sub_cate">
                                    <option value="">请选择</option>
                                    @if(count($cloths) > 0)
                                        @foreach($cloths as $k=>$v)
                                            <option value="{{ $v->id }}">{{ $v->name }}</option>
                                        @endforeach
                                    @endif
                                </select>
                            </li>
                            <li class="form_li"><span class="xing">*</span>小类：
                                <select class="sel_inp ip4 small_cate">
                                    <option value="">请选择</option>
                                </select>
                            </li>
                        </ul>
                        <ul class="form_ul">
                            <li class="form_li"><span class="xing">*</span>供应商：<input id="testInput" class="form_inp ip5" type="text" placeholder="供应商" autocomplete="off" autocorrect="off" value=""/></li>
                            <li class="form_li form_lis"><span class="xing">*</span>供应商货号：<input class="form_inp ip6" type="text" autocomplete="off" autocorrect="off" maxlength="20" placeholder="供应商货号"/></li>
                            <li class="form_li"><span class="xing">*</span>规格：<input class="form_inp ip7" type="text" autocomplete="off" autocorrect="off" maxlength="7" placeholder="规格(门幅)" /></li>
                            <li class="form_li"><span class="xing">*</span>排版：<input class="form_inp ip8" type="text" autocomplete="off" autocorrect="off" maxlength="7" placeholder="排版(门幅)" /></li>
                        </ul>
                        <ul class="form_ul">
                            <li class="form_li"><span class="xing">*</span>参考价：<input class="form_inp ip9" type="text" autocomplete="off" autocorrect="off" maxlength="7" placeholder="参考采购价" /></li>
                            <li class="form_li"><span class="xing">*</span>采购单位：
                                <select class="sel_inp ip10">
                                    <option value="">请选择</option>
                                    @if(count($fabric_unit)>0)
                                        @foreach ($fabric_unit as $k=>$v)
                                            <option value="{{$k}}" abc="{{$v['purchase_bom_unit']}}">{{$v['purchase_data']}} </option>
                                        @endforeach
                                    @endif
                                </select>
                            </li>
                            <li class="form_li"><span class="xing">*</span>单位换算：<input class="form_inp ip11"  type="text" autocomplete="off" autocorrect="off" maxlength="7" placeholder="单位换算"/></li>
                        </ul>
                        <div class="form_main">主要成分：<input class="inp_main ip12" type="text" autocomplete="off" autocorrect="off" placeholder="主要成分"/></div>
                        <ul class="form_ul">
                            <li style="float:left;line-height:30px;margin-right:9px;"><span class="xing">*</span>颜色：</li>
                            <button type="button" class="btn btn-primary addBTN">+</button>
                            {{--<button type="button" class="btn btn-primary delBTN">-</button>--}}
                        </ul>
                        <ul class="form_ul" style="height:auto;">
                            <table class="colorTab">
                                <tr><td>颜色</td><td>厂家颜色说明</td><td style="width:50px;">操作</td></tr>
                                <tr class="colorTr">
                                    <td><input id="colorInput0" class="sel_color" type="text" autocomplete="off" autocorrect="off" placeholder="输入颜色"/></td>
                                    <td><input id="expInput0" class="explain" type="text" autocomplete="off" autocorrect="off" value="#" placeholder="输入说明"/></td>
                                    <td><a href="javascript:;" onclick="delBTN(this)">删除</a></td>
                                </tr>
                                <tr class="colorTr">
                                    <td><input id="colorInput1" class="sel_color" type="text" autocomplete="off" autocorrect="off" placeholder="输入颜色"/></td>
                                    <td><input id="expInput1" class="explain" type="text" autocomplete="off" autocorrect="off" value="#" placeholder="输入说明"/></td>
                                    <td><a href="javascript:;" onclick="delBTN(this)">删除</a></td>
                                </tr>
                                <tr class="colorTr">
                                    <td><input id="colorInput2" class="sel_color" type="text" autocomplete="off" autocorrect="off" placeholder="输入颜色"/></td>
                                    <td><input id="expInput2" class="explain" type="text" autocomplete="off" autocorrect="off" value="#" placeholder="输入说明"/></td>
                                    <td><a href="javascript:;" onclick="delBTN(this)">删除</a></td>
                                </tr>
                                <tr class="colorTr">
                                    <td><input id="colorInput3" class="sel_color" type="text" autocomplete="off" autocorrect="off" placeholder="输入颜色"/></td>
                                    <td><input id="expInput3" class="explain" type="text" autocomplete="off" autocorrect="off" value="#" placeholder="输入说明"/></td>
                                    <td><a href="javascript:;" onclick="delBTN(this)">删除</a></td>
                                </tr>
                                <tr class="colorTr">
                                    <td><input id="colorInput4" class="sel_color" type="text" autocomplete="off" autocorrect="off" placeholder="输入颜色"/></td>
                                    <td><input id="expInput4" class="explain" type="text" autocomplete="off" autocorrect="off" value="#" placeholder="输入说明"/></td>
                                    <td><a href="javascript:;" onclick="delBTN(this)">删除</a></td>
                                </tr>
                            </table>
                        </ul>
                    </div>
                    <div class="form-group">
                        <button type='button' abc="{{$id}}" class='form_add btn btn-success' onclick="addInfos()">添加</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <script>
        $.selectSuggest('testInput', suppliers);
        $.selectSuggest('colorInput0', colors);
        $.selectSuggest('colorInput1', colors);
        $.selectSuggest('colorInput2', colors);
        $.selectSuggest('colorInput3', colors);
        $.selectSuggest('colorInput4', colors);
    </script>
    <script src="{{env('CDN_DOMAIN_NAME')}}/js/createLining.js?v=1.1.3"></script>
@endsection
